import storageApi from '../../../core/storage/storage';

function problemListController($rootScope, $scope, homeStatsService) {
  'ngInject';

  // 施工队列表
  this.getConstruction = () => {
    this.hasConsNum = false;
    homeStatsService
      .queryConstruction({ mapParams: { orgId: $rootScope.orgId || storageApi.get('orgId') } })
      .then((res) => {
        if (res.success) {
          this.constructionList = res.rows;
          if (this.constructionList && this.constructionList.length > 0) {
            this.hasConsNum = true;
          }
        } else {
          this.hasConsNum = false;
        }
      });
  };

  this.getConstruction();
}

export default problemListController;
